﻿using System;
using System.Collections.Generic;
using System.Text;
using System.Data;

namespace Model
{
    [Serializable]
    public partial class Pot0b01
    {
		private string _frameid;
		private string _usercode;
		private string _tmp3;
		private string _tmp1;
		private string _tmp2;
		
        /// <summary>
        /// 商品结构
        /// </summary>
		public string Frameid
		{
			get { return _frameid;	 }
			set { _frameid=value;	}
		}
        /// <summary>
        /// 用户
        /// </summary>
		public string Usercode
		{
			get { return _usercode;	 }
			set { _usercode=value;	}
		}
        /// <summary>
        /// 备用字段3
        /// </summary>
		public string Tmp3
		{
			get { return _tmp3;	 }
			set { _tmp3=value;	}
		}
        /// <summary>
        /// 备用字段
        /// </summary>
		public string Tmp1
		{
			get { return _tmp1;	 }
			set { _tmp1=value;	}
		}
        /// <summary>
        /// 备用字段2
        /// </summary>
		public string Tmp2
		{
			get { return _tmp2;	 }
			set { _tmp2=value;	}
		}
		
		public static List<Pot0b01> GetPot0b01ListByDataTable(DataTable dt)
		{
			if(dt == null) return null;
		    List<Pot0b01> list = new List<Pot0b01>();
		   
			foreach(DataRow dr in dt.Rows)
            {
				Pot0b01 model = GetPot0b01ByDataRow(dr);
				if(null == model) continue;
				
				list.Add(model);
            }
           return list;
		}
		
		public static Pot0b01 GetPot0b01ByDataRow(DataRow dr)
		{
			Pot0b01 model = new Pot0b01(); //实例化Pot0b01
	
			DataColumnCollection dcc = dr.Table.Columns;

			if (dcc.Contains("frameid")&&!(dr["frameid"] is System.DBNull))  
				model.Frameid = ( string)dr["frameid"];
			if (dcc.Contains("usercode")&&!(dr["usercode"] is System.DBNull))  
				model.Usercode = ( string)dr["usercode"];
			if (dcc.Contains("tmp3")&&!(dr["tmp3"] is System.DBNull))  
				model.Tmp3 = ( string)dr["tmp3"];
			if (dcc.Contains("tmp1")&&!(dr["tmp1"] is System.DBNull))  
				model.Tmp1 = ( string)dr["tmp1"];
			if (dcc.Contains("tmp2")&&!(dr["tmp2"] is System.DBNull))  
				model.Tmp2 = ( string)dr["tmp2"];
			
			return model;
		}
    }
}
